import { Entity, Unique, Column } from 'typeorm';
import { CommonEntity } from './common.entity';

@Entity('role_access')
// 唯一键约束
@Unique('role_access_type_deleted', ['roleId', 'accessId', 'deletedAt'])
export class RoleAccessEntity extends CommonEntity {
  @Column({
    type: 'int',
    nullable: false,
    name: 'role_id',
    comment: '角色id',
  })
  roleId: number;

  @Column({
    type: 'int',
    nullable: false,
    name: 'access_id',
    comment: '资源id',
  })
  accessId: number;
}
